export const toKebabCase = (str: string): string => str.replace(/\B([A-Z])/g, '-$1').toLowerCase()

export const toPascalCase = (str: string): string =>
  str
    .replace(/^./, match => match.toUpperCase())
    .replace(/-(\w)/g, (_, p: string) => p?.toUpperCase() ?? '')

export const toCamelCase = (str: string): string =>
  str
    .replace(/^./, match => match.toLowerCase())
    .replace(/-(\w)/g, (_, p: string) => p?.toUpperCase() ?? '')
